import { createApp } from 'vue';
import piniaStore from './store';
import router from './router';
import App from './App.vue';
import '@/styles/index.scss';
import '@/permission';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import 'uno.css';
// import 'vue-global-api';
import * as myCompontents from '@jackz-plus/elp';
import '@jackz-plus/elp/dist/style.css';
import 'element-plus/theme-chalk/index.css';
// 支持SVG
import 'virtual:svg-icons-register';
import registerAppGlobal from '@/utils/app-global';
const app = createApp(App);
//注册挂载全局属性
registerAppGlobal(app);

//注册自己ui库所有组件
const excludeName = ['VcMenu'];
for (const [key, component] of Object.entries(myCompontents)) {
    //选择性注册
    if (!excludeName.includes(key)) {
        app.component(key, component);
    }
}
//注册element-plus/icons-vue
app.use(router).use(piniaStore).mount('#app');
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
